package org.redog.beanfactory;


import org.redog.beanfactory.dao.UserDao;
import org.redog.beanfactory.service.UserService;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;

/**
 * Hello world!
 *
 */
public class App 
{
    public static void main( String[] args )
    {
        System.out.println( "Hello World!" );
        DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory();
        XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(beanFactory);
        reader.loadBeanDefinitions("beans.xml");
        UserService userService = (UserService)beanFactory.getBean("userService");
        System.out.println(userService);

        UserDao userDao = (UserDao)beanFactory.getBean("userDao");
        System.out.println(userDao);
    }
}
